<!DOCTYPE html>
<html>
<head>
	<title>dom1</title>
	<meta charset="utf-8">
</head>
<body>
	<input type="text" id="txt1">
	<input type="button" id="btn1" value="创建li">
	<ul id="ul1">
		<li>a</li>
	</ul>
	<script type="text/javascript">
	window.onload = function(){
		var oBtn = document.getElementById("btn1")
		var oTxt = document.getElementById("txt1")
		var oUl = document.getElementById("ul1")
		oBtn.onclick=function(){
			var oLi = document.createElement("li")

			oLi.innerHTML=oTxt.value
			oUl.appendChild(oLi)
		}


	}
	</script>
</body>
</html>